package com.xd.clap.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xd.clap.commons.Category;
import com.xd.clap.commons.Source;
import com.xd.clap.handler.CategoryTypeHandler;
import com.xd.clap.handler.SourceTypeHandler;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class Advise {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ExcelProperty("手机号")
    private String phone;

    @ExcelProperty("位置")
    private String location;

    @ExcelProperty("详细位置")
    private String fullAddress;

    @ExcelProperty("一级辖区")
    private String firstAddress;

    @ExcelProperty("二级辖区")
    private String secondAddress;

    @ExcelProperty("链接")
    private String url;

    @ExcelProperty("内容")
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ExcelProperty("发布时间")
    private Date time;

    @ExcelProperty("来源")
    @TableField(typeHandler = SourceTypeHandler.class)
    private Source source;

    @ExcelProperty("类型")
    @TableField(typeHandler = CategoryTypeHandler.class)
    private Category category;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelProperty("创建时间")
    private Date createTime;

    @ExcelProperty("状态代码")
    private Integer stateCode;

    @ExcelProperty("状态")
    private String state;

    @ExcelProperty("催办次数")
    private Integer count = 0;

    @ExcelProperty("评分")
    private Integer rate = 0;

    @ExcelProperty(value = "图片列表")
    @TableField(exist = false)
    private List<Image> imageList;

    @ExcelProperty("经度")
    private String longitude;

    @ExcelProperty("纬度")
    private String latitude;


}
